package com.xnfh.login.viewmodel

import com.xnfh.framework.base.BaseRepository
import com.xnfh.framework.bean.RespStateData
import com.xnfh.framework.bean.UserInforBean
import com.xnfh.network.manager.ApiManager

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2024/1/3 16:26
 * @UpdateUser: ziheng
 * @UpdateDate: 2024/1/3 16:26
 * @UpdateRemark: 更新说明
 */
class LoginViewModelRes : BaseRepository() {
    suspend fun requestSendCode(tel: String, data: RespStateData<String>) = dealResp(
        { ApiManager.api.requestSendCode(tel, tel) }, data
    )

    suspend fun requestCheckSmsCode(tel: String, code: String, data: RespStateData<String>) =
        dealResp(
            { ApiManager.api.requestSmsCode(tel, code) }, data
        )

    suspend fun requestLogin(tel: String, data: RespStateData<UserInforBean>) = dealResp(
        { ApiManager.api.requestLogin(tel) }, data
    )
}